const getType = Object.prototype.toString

export function isString(val) {
  return getType.call(val) === '[object String]'
}

export function isObject(val) {
  return getType.call(val) === '[object Object]'
}

export function isNumber(val) {
  return getType.call(val) === '[object Number]'
}

export function isArray(val) {
  return getType.call(val) === '[object Array]'
}

export function isSymbol(val) {
  return getType.call(val) === '[object Symbol]'
}

export function isHtmlElement(node) {
  return node && node.nodeType === Node.ELEMENT_NODE
}

export const isFunction = (val) => {
  return val && getType.call(val) === '[object Function]'
}

export const isUndefined = (val) => {
  return val === undefined
}

export const isNull = (val) => {
  return val === null
}

export const isDefined = (val) => {
  return val !== undefined && val !== null
}

export const isEmpty = (val) => {
  return val === undefined || val === null || val === ''
}
